{% extends 'store_admin/web_store/pages.html' %}
{% load i18n %}

{% block title_sub_menu %}{{ page.title|title }} page{% endblock %}

{% block toolbar %}
	<a href="{% url web_store_pages %}"><img src="{{ MEDIA_URL}}img/add.png" class="icon"/>{% trans "Add Page" %}</a>
	<a href="javascript:delete_object('{% url page_delete page.id %}', 'page')">
		<img src="{{ MEDIA_URL}}img/remove.png" class="icon"/>{% trans "Delete Page" %}
	</a>
{% endblock %}

{% block main_pages %}
	
	<form name="form" method="post" action="." enctype="multipart/form-data">
	
		<h4>{% trans "Name" %}:</h4>
		{% if form.name.errors %}<div class="error">{{ form.name.errors|join:", " }}</div>{% endif %}
		{{ form.name }}
		<br/>
		
		<h4>{% trans "Name link" %}:</h4>
		{% if form.name_link.errors %}<div class="error">{{ form.name_link.errors|join:", " }}</div>{% endif %}
		http://{{ shop.name }}.{{ DEFAULT_DNS }}/pages/{{ form.name_link }}	
		<br/>

		<h4>{% trans "Title" %}:</h4>
		{% if form.title.errors %}<div class="error">{{ form.title.errors|join:", " }}</div>{% endif %}
		{{ form.title }}	
		<br/>

		<h4>{% trans "Write your page" %}:</h4>
		{% if form.body.errors %}<div class="error">{{ form.body.errors|join:", " }}</div>{% endif %}
		{{ form.body }}	
		<br/>

		<h4>{% trans "Put the Meta-Content here (for SEO purposes)" %}:</h4>
		{% if form.meta_content.errors %}<div class="error">{{ form.meta_content.errors|join:", " }}</div>{% endif %}
		{{ form.meta_content }}	
		<br/>
		
		{% if form.visible.errors %}<div class="error">{{ form.visible.errors|join:", " }}</div>{% endif %}
		<h4>{% trans "Visible" %}:{{ form.visible }}</h4>
		<br/>

		<br/>
		<br/>

		<button type="submit" class="large awesome">{% trans "Save" %}</button>
		<a href="{% url web_store_pages %}" class="link_cancel">{% trans "Or Cancel" %}</a>
	</form>

{% endblock %}